package com.igeekhome.ccs.biz.impl;

import com.igeekhome.ccs.biz.ITransferSessionBiz;
import com.igeekhome.ccs.entity.CustomerService;
import com.igeekhome.ccs.entity.TransferSession;
import com.igeekhome.ccs.mapper.CustomerServiceMapper;
import com.igeekhome.ccs.mapper.SessionMapper;
import com.igeekhome.ccs.mapper.TransferSessionMapper;
import org.springframework.beans.factory.annotation.Autowired;

public class TransferSessionBizImpl implements ITransferSessionBiz {
    @Autowired
    TransferSessionMapper tsm;
    @Autowired
    CustomerServiceMapper csm;
    @Autowired
    SessionMapper sm;
    @Override
    public int createTransferSession(TransferSession t) {
        tsm.create(t);

        CustomerService cs=csm.getCsByGroupAndNickname(t.getGroupId(),t.getNickName());
        sm.transferSession(cs.getCsId(),t.getSessionId());

        return 0;
    }
}
